package co.edu.unal.satacredito.database.administration.ejb;

import java.net.UnknownHostException;
import java.util.Date;
import java.util.List;

import javax.ejb.Stateless;

import co.edu.unal.satacredito.database.administration.exceptions.DAOException;
import co.edu.unal.satacredito.database.administration.singleton.SingletonDataStore;
import co.edu.unal.satacredito.database.connection.TransactionDatastoreFactory;
import co.edu.unal.satacredito.database.dao.FileLogMongoDao;
import co.edu.unal.satacredito.database.dao.NotSyntaxTransactionMongoDao;
import co.edu.unal.satacredito.database.entity.NotSyntaxTransaction;

import com.mongodb.MongoException;

/**
 * Session Bean implementation class MonitorDaoEJB
 */
@Stateless
public class NotSyntaxTransactionDaoEJB implements
		NotSyntaxTransactionDaoEJBLocal, NotSyntaxTransactionDaoEJBRemote {

	private NotSyntaxTransactionMongoDao daoT;

	/**
	 * Default constructor.
	 * 
	 * @throws DAOException
	 */
	public NotSyntaxTransactionDaoEJB() throws DAOException {
		this.daoT = new NotSyntaxTransactionMongoDao(SingletonDataStore.getInstance()
				.getDataStore());
	}

	public List<NotSyntaxTransaction> findNotSyntaxByDate(Date initDate,
			Date endDate) throws DAOException {
		try {
			return daoT.searchInvalidBySynt(initDate, endDate);
		} catch (Exception e) {
			throw new DAOException(e.getMessage());
		}
	}

}
